home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-14 | 4.6 KB | 116 lines | [TEXT/MPS ] |
-
- \ Open Firmware FCode driver for the NCR 8250S PCI-SCSI Card
- \
- \ by Monte Benaresh -- October 19, 1994
- \
- \ Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
- \
-
- \ ** This is a slight modification of NCR.of, which shows how you would use
- \ it with the Open Firmware User Interface. To download this code,
- \ type dl at the OF UI prompt, then send file (make sure it's using text tool),
- \ type <ctrl-d> to end the download.
- \ Or, you can copy and paste instead of send file.
-
- \ This is a minimal FCode driver which simply provides identifying information
- \ in its device node, and creates a property in its device node which contains
- \ the runtime driver to be loaded into the Mac system heap by the Expansion Bus
- \ Manager. It also creates children nodes specific to SCSI bus devices.
-
- \ push arguments on the stack for pci-header:
- \ *** THESE MUST MATCH THE CONFIG REGISTERS FOR YOUR ***
- \ *** FCODE TO BE RECOGNIZED BY OPEN FIRMWARE ***
- \ vendor #, device #, class-code = SCSI bus controller
-
- \ ** tokenizer, pci-header, fcode-version2 are tokenizer words
- \ tokenizer[ hex 1000 0003 010000 decimal ]tokenizer
- \ pci-header \ generate proper PCI image header
-
- \ fcode-version2 \ generate proper FCode header (within PCI image)
-
- \ ** This is meant to be downloaded to the machine when it's
- \ in the state after a reset-all
-
- \ Push arguments that describe where we want a new device node to be created
- 0 0 " D" " /bandit"
-
- \ We create a package (node), and open an instance of it
- begin-package
-
- \ ** Here begins the common code in NCR.of
- " AAPL,NCR8250S" device-name \ Apple is card vendor
- " scsi" device-type
- " 8250S" model
-
- \ generate a "reg" property which lists our configuration space at the start of
- \ our assigned space, with 0 size (as required by the PCI Binding Supplement)
-
- 0 0 my-space encode-phys
- 0 encode-int 0 encode-int encode+ encode+ \ config space
-
- \ The next entry is for the onboard ROM memory space, and is
- \ if you are using encode-file to encapsulate your runtime
- \ driver.
-
- 0 0 my-space h# 02000030 or encode-phys
- 0 encode-int h# 00008000 encode-int encode+ encode+ \ ROM space
- encode+
- 0 0 my-space h# 02000014 or encode-phys
- 0 encode-int h# 00000100 encode-int encode+ encode+ \ memory space
- encode+ " reg" property
-
- \ generate a "power-consumtion" property which lists standby and full-on power
- \ consumtion for various power rails in microwatts; if we don't create this
- \ property, Open Firmware will create one by filling in the "unspecified" rail
- \ entries from the PRSNT pins (since we know our power consumption, we fill the
- \ "unspecified" entries with zeros)
-
- 0 encode-int 0 encode-int encode+ \ "unspecified"
- d# 7500000 encode-int d# 7500000 encode-int encode+ encode+ \ +5V
- 0 encode-int 0 encode-int encode+ encode+ \ +3V
- d# 8100000 encode-int d# 8100000 encode-int encode+ encode+ \ I/O power
- \ remaining entries are 0 and can be omitted
- \ 0 encode-int 0 encode-int encode+ encode+ \ reserved
- " power-consumption" property
-
-
- \ the following properties will be automatically generated for this card:
- \ "has-fcode"
- \ "vendor-id" - from PCI configuration register
- \ "device-id" - from PCI configuration register
- \ "revision-id" - from PCI configuration register
- \ "class-code" - from PCI configuration register
- \ "interrupts" - from PCI configuration register
- \ "min-grant" - from PCI configuration register
- \ "max-latency" - from PCI configuration register
- \ "devsel-speed" - from PCI configuration register
- \ "fast-back-to-back" - from PCI configuration register
- \ "assigned-addresses"
-
- \ we don't need to define any methods here; there is enough information for the
- \ runtime driver to be able to locate the card, but a complete FCode implementation
- \ would provide boot-time I/O services
-
-
- \ include an image of the runtime driver, and have it assigned as the value of a
- \ property that the Expansion Bus Manager will read at startup
-
- \ the name of the property takes the form, "driver,<company>,<osname>,<isa>"
- \ NOTE: in the following example, the given <osname> (for Macintosh System 7)
- \ is preliminary and subject to change
-
- \ ** Here ends the common code in NCR.of
-
- \ ** encode-file, fcode-end, pci-end are tokenizer words
- \ encode-file runtime.bin " driver,AAPL,MacOS,PowerPC" property
-
-
- \ fcode-end \ terminate normal FCode
- \ pci-end \ complete the PCI image
-
- \ ** now close it off
- assign-addresses \ Tell the USER INTERFACE to emulate OpenFirmware address assignment
- make-properties \ This gives us the standard automatically generated PCI properties
- .properties \ This just displays some informative stuff
- end-package \ This terminates this package (node) definition
-